function init() {
	var APP_ID = 'gjlsC5QLQIzWGXGIxBfGKaH3-gzGzoHsz';
	var APP_KEY = 'asKm6l9c0PKBwsyHKUvsQwnh';
	AV.init({
		appId: APP_ID,
		appKey: APP_KEY
	});
}

function loginout() {
	AV.User.logOut();
	location.href = "index.html"
}

function getUrlItem(url, name) {
	start = url.indexOf(name + "=")
	if(start != -1) {
		start = start + name.length + 1
		c_end = url.indexOf("&", start)
		if(c_end == -1) c_end = url.length
		return unescape(url.substring(start, c_end))
	}
	return '';
}

function getPageUrl() {
	var index = location.pathname.lastIndexOf("/") //获取当前页面
	var ret = location.pathname.substr(index + 1)
	return escape(ret)
}

function getPageUrl2() {
	var index = location.pathname.lastIndexOf("/") //获取当前页面
	var ret = location.pathname.substr(index + 1) + location.search
	return escape(ret)
}

function getUrlPro(name) {
	var url = location.search
	start = url.indexOf(name + "=")
	if(start != -1) {
		start = start + name.length + 1
		c_end = url.indexOf("&", start)
		if(c_end == -1) c_end = url.length
		return unescape(url.substring(start, c_end))
	}
	return '';
}